#pragma once
#ifndef Lock_hpp
#define Lock_hpp

#include"MutexInterface.hpp"

namespace MMF{


    class LockGuard
    {

        MutexInterface& mMutex;

    public:

        LockGuard(MutexInterface& mutex)
            : mMutex(mutex)
        {
            mMutex.Lock();
        }

        ~LockGuard()
        {
            mMutex.Unlock();
        }

        LockGuard(const LockGuard&)            = delete;
        LockGuard& operator=(const LockGuard&) = delete;
    };
}

#endif